﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ManageFile.aspx.cs" Inherits="Manageweb_ManageFile_ManageFile" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    <link href="../images/css.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table border="1" cellpadding="0" cellspacing="0" width="750">
                <tr>
                    <td style="font-weight: bold; color: white; background-color: #507cd1; text-align: left">
                        &nbsp;管理下载中心<asp:Label ID="LB_ID" runat="server" Visible="False"></asp:Label></td>
                </tr>
            </table>
            <br />
            <table width="750" border="1" cellspacing="0" cellpadding="0" id="TABLE_Add_Mod" runat="server">
                <tr>
                    <td colspan="2" style="font-weight: bold; color: white; background-color: #507cd1; text-align: left">
                        &nbsp;<asp:Label ID="LB_TableTitle" runat="server"></asp:Label></td>
                </tr>
                <tr>
                    <td style="width: 150px">
                        &nbsp;标题</td>
                    <td style="text-align: left">
                        &nbsp;<asp:TextBox ID="TB_Title" runat="server" Width="189px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RFV_TB_Title" runat="server" ControlToValidate="TB_Title"
                            Display="Dynamic" ErrorMessage="*" ValidationGroup="Btn_Submit"></asp:RequiredFieldValidator></td>
                </tr>
                <tr>
                    <td>
                        &nbsp;文档</td>
                    <td style="text-align: left">
                        &nbsp;<asp:FileUpload ID="FU_File" runat="server" />
                        <asp:RequiredFieldValidator ID="RFV_FU_File" runat="server" ControlToValidate="FU_File"
                            Display="Dynamic" ErrorMessage="*" ValidationGroup="Btn_Submit"></asp:RequiredFieldValidator>
                        <asp:HyperLink ID="HL_File" runat="server">点击下载</asp:HyperLink></td>
                </tr>
                <tr>
                    <td>
                        &nbsp;描述</td>
                    <td style="text-align: left">
                        &nbsp;<asp:TextBox ID="TB_Description" runat="server" Height="100px" TextMode="MultiLine"
                            Width="300px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td colspan="2" style="font-weight: bold; color: white; background-color: #507cd1; text-align: center;">
                        <asp:Button ID="Btn_Submit" runat="server" Text="提交" ValidationGroup="Btn_Submit" />
                        <asp:Button ID="Btn_Cancel" runat="server" Text="取消" />&nbsp;</td>
                </tr>
            </table>
            <br />
            <asp:Label ID="LB_ManageFile" runat="server" Font-Bold="True" Font-Size="Small" ForeColor="Red"></asp:Label>
            <table border="1" cellpadding="0" cellspacing="0" width="750">
                <tr>
                    <td>
                        <asp:GridView ID="GV_FileList" runat="server" AllowPaging="True" AllowSorting="True"
                            AutoGenerateColumns="False" CellPadding="4" DataKeyNames="File_ID" DataSourceID="ODS_FileList"
                            ForeColor="#333333" PageSize="20" Width="100%">
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <Columns>
                                <asp:BoundField DataField="File_ID" HeaderText="File_ID" InsertVisible="False" ReadOnly="True"
                                    SortExpression="File_ID" Visible="False" />
                                <asp:BoundField DataField="File_Title" HeaderText="标题" SortExpression="File_Title" />
                                <asp:TemplateField SortExpression="File_URL">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("File_URL") %>'></asp:TextBox>
                                    </EditItemTemplate>
                                    <ItemTemplate>
                                        <asp:HyperLink ID="HL_FileURL" runat="server" NavigateUrl='<%# FormatFileURL(Eval("File_URL")) %>'>点击下载</asp:HyperLink>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:Button ID="Btn_Add" runat="server" Text="添加" OnCommand="Btn_Add_Command" />
                                        <asp:Button ID="Btn_Mod" runat="server" CommandArgument='<%# Eval("File_ID") %>'
                                            Text="修改" OnCommand="Btn_Mod_Command" />
                                        <asp:Button ID="Btn_Del" runat="server" CommandArgument='<%# Eval("File_ID") %>'
                                            OnClientClick="return confirm('删除操作不可恢复，是否继续？')" Text="删除" OnCommand="Btn_Del_Command" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="File_DateTime" HeaderText="上传时间" SortExpression="File_DateTime" />
                            </Columns>
                            <RowStyle BackColor="#EFF3FB" />
                            <EditRowStyle BackColor="#2461BF" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                            <EmptyDataRowStyle BackColor="#507CD1" />
                            <EmptyDataTemplate>
                                <asp:Button ID="Btn_Add" runat="server" OnCommand="Btn_Add_Command" Text="添加新文档" />
                            </EmptyDataTemplate>
                        </asp:GridView>
                        <asp:ObjectDataSource ID="ODS_FileList" runat="server" OldValuesParameterFormatString="original_{0}"
                            SelectMethod="GetDataMain" TypeName="AccessDAL.FileTableAdapters.FileTableAdapter">
                        </asp:ObjectDataSource>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>
